package sk.mka.utils.constants;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author katrami
 * @date Dec 10, 2010
 */
public enum Separator {

    EMPTY_SPACE(" "), EQUALS_SEPARATOR("="), TABULATOR_SEPARATOR("\t");
    private final String name;

    private Separator(String name) {
        this.name = name;
    }
    private static final Map<String, Separator> stringToEnum = new HashMap<String, Separator>();

    static {
        for (Separator t : values()) {
            stringToEnum.put(t.toString(), t);
        }
    }

    @Override
    public String toString() {
        return name;
    }

    public static Separator fromString(String symbol) {
        return stringToEnum.get(symbol);
    }
}
